package nio.socket.nonblocking;

/**
 * 非IO阻塞的服务器端实现
 */
public class NonBlockingTest {
    private static int port = 9999;
    private static String host = "127.0.0.1";

    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            NonBlockingServer.start(port);
        },"server").start();

        Thread.sleep(1000);

        new Thread(()->{
            Client.post(host, port, 3000);
        },"client1").start();

        new Thread(()->{
            Client.post(host, port, 3000);
        },"client2").start();

        Thread.sleep(1000);
    }
}
